﻿@model WeProjectsModel.Task
<style type="text/css">
    input[type="text"].text-box {
        width: 160px;
    }
</style>

@{
    ViewBag.Title = "Edit";
        int userId = int.Parse(Membership.GetUser().ProviderUserKey.ToString());
    @*不是组长，也不是管理员*@
    if(!Roles.IsUserInRole("sysadmin") && Model.Project.OwnerID!=userId)
    {
        Response.Write("当前用户没有权限操作");
        Response.End();
    }
}
@Html.Partial("../project/_projectMenu2")
<h2>
    @Model.Project.Title > 编辑任务
</h2>


@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
@Html.HiddenFor(m => m.ID, new { Value = Html.ViewContext.RouteData.Values["id"] })
    @Html.HiddenFor(m => m.ProjectID)
    <div class="form-horizontal">
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label">任务描述</label>
            <div class="col-xs-10 col-md-10">
                @Html.EditorFor(model => model.Description)
                @Html.ValidationMessageFor(model => model.Description)
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label">截止日期</label>
            <div class="col-xs-10 col-md-10">
                @Html.EditorFor(model => model.Due)
                @Html.ValidationMessageFor(model => model.Due)
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label">参与人员</label>
            <div class="col-xs-10 col-md-10">
                @Html.EditorFor(model => model.Responsibility)
                @Html.ValidationMessageFor(model => model.Responsibility)
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label">说明</label>
            <div class="col-xs-10 col-md-10">
                @Html.TextAreaFor(m => m.Comment, new { @class="width-50"})
            </div>
        </div>
        @*<table class="table">
                    <tr><td>任务描述</td><td>@Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)</td></tr>
                    <tr><td>截止日期</td><td>@Html.EditorFor(model => model.Due)
            @Html.ValidationMessageFor(model => model.Due)</td></tr>
                    <tr><td>参与人员</td><td>@Html.EditorFor(model => model.Responsibility)
            @Html.ValidationMessageFor(model => model.Responsibility)</td></tr>
                    <tr><td>说明</td><td>@Html.TextAreaFor(m => m.Comment)</td></tr>
                    </table>*@


        @*<fieldset>
            <legend>Task</legend>

            @Html.HiddenFor(model => model.ID)

            <div class="editor-label">
                @Html.LabelFor(model => model.Description)
            </div>
            <div class="editor-field">

            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Due)
            </div>
            <div class="editor-field">

            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Responsibility)
            </div>
            <div class="editor-field">

            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Comment)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Comment)
                @Html.ValidationMessageFor(model => model.Comment)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.ProjectID, "Project")
            </div>
            <div class="editor-field">
                @Html.DropDownList("ProjectID", String.Empty)
                @Html.ValidationMessageFor(model => model.ProjectID)
            </div>*@

        <div class="form-group">
            <label class="col-xs-2 col-md-2 control-label"></label>
            <div class="col-xs-10 col-md-10">
                <input type="submit" value="提交" class="btn btn-success" />
            </div>
        </div>
    </div>
}

@*<div>
    @Html.ActionLink("返回列表", "Details", "Project", new { id = Model.ProjectID }, new { })
</div>*@

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
